﻿@using Topro.Entity.Response.WarehouseUnit
@using Topro.Entity.Enum
@using Topro.Util

@model Topro.Entity.PagedList<WarehouseUnitQueryResponse>

<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_c" width="75">巷道</th>
                        <th class="t_c" width="120">货位</th>
                        <th class="t_c" width="75">排</th>
                        <th class="t_c" width="75">列</th>
                        <th class="t_c" width="75">层</th>
                        <th class="t_c" width="75">方位</th>
                        <th class="t_c" width="75">锁定</th>
                        <th class="t_l">备注</th>
                        <th class="t_c" width="55">状态</th>
                        <th class="t_c" width="110">操作</th>
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (List<Topro.Entity.Response.WarehouseUnit.WarehouseUnitQueryResponse>)Model.TData)
                        {
                    <tr>
                        <td class="t_c" width="75">@(item.Type)</td>
                        <td class="t_c" width="120">@(item.Id)</td>
                        <td class="t_c" width="75">@(item.Pai.ToString("00"))</td>
                        <td class="t_c" width="75">@(item.Lie.ToString("00"))</td>
                        <td class="t_c" width="75">@(item.Ceng.ToString("00"))</td>
                        <td class="t_c" width="75">@(item.Fix.ToString("00"))</td>
                        <td class="t_c" width="75">
                            @(item.Locked == (sbyte)WarehouseLocked.是 ? Html.Raw("<span class='green bold'>是</span>") : Html.Raw("<span class='red bold'>否</span>"))
                        </td>
                        <td class="t_l">@(item.Remark)</td>

                        <td class="t_c">
                            @if (item.Locked == (sbyte)WarehouseLocked.是)
                            {
                                <a class="btn btn-danger btn-xs" data-confirm="确定要解锁该权限？" data-href="/WarehouseUnit/Locked?id=@(item.Id)">解锁</a>
                            }
                        </td>
                        <td class="t_c" width="110">
                            @if (item.Status == (sbyte)WarehouseStatus.启用)
                            {
                                <a class="btn btn-danger btn-xs" data-confirm="确定要禁用该权限？" data-succesFun="doSearch()" data-href="/WarehouseUnit/UpdateStatus?id=@(item.Id)&status=@((sbyte)WarehouseStatus.禁用)">禁用</a>
                            }
                            else
                            {
                                <a class="btn btn-primary btn-xs" data-confirm="确定要启用该权限？" data-succesFun="doSearch()" data-href="/WarehouseUnit/UpdateStatus?id=@(item.Id)&status=@((sbyte)WarehouseStatus.启用)">启用</a>
                            }
                            <button type="button" class="btn btn-default btn-xs" data-modal="/WarehouseUnit/WarehouseUnitAddOrEdit/@(item.Id)" data-title="编辑" data-width="400" data-height="475"><span class="glyphicon glyphicon-edit"></span> 编辑</button>
                        </td>
                    </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="11" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />